#include "searchlineedit.h"

bool SearchLineEdit::mousePress = false;

SearchLineEdit::SearchLineEdit(QWidget *p) : QLineEdit(p)
{

}

void SearchLineEdit::focusInEvent(QFocusEvent *e)
{
    if (!hasSelectedText())
    {
        QLineEdit::focusInEvent(e);
        mousePress = true;
    }
}

void SearchLineEdit::mousePressEvent(QMouseEvent *m)
{
    QLineEdit::mousePressEvent(m);
    if(mousePress)
    {
        selectAll();
        mousePress = false;
    }
}
